package main

import (
	"fiber-layout/provider/config"
	"fiber-layout/provider/database"
	log2 "fiber-layout/provider/logger"
	"fiber-layout/routes"
	"github.com/gofiber/fiber/v2"
)

func main() {
	// 加载配置
	config.InitConfig()
	//初始化日志
	log2.InitLogger()
	//初始化数据 迁移
	database.InitPGSql()
	//初始化fiber
	app := fiber.New()
	//加载路由
	routes.Load(app)
	//设置静态目录
	app.Static("/", "./public")
	//开启服务
	err := app.Listen(":3000")
	if err != nil {
		log2.Log.Fatal("监听失败: " + err.Error())
	}
}
